package sctu.edu.java.year2016.team03.liyouhong.day20160522.chapter6_1;

/**
 * Created by Administrator on 2016/5/22 0022.
 * 1.在项目中创建Number类，判断字符串“mingrikejijavabu”中字符‘i’出现了几次‘并将结果输出。
 */
public class Number {
    public static void main(String[] args) {
        int sum=0;
        char a1[]={'i'};
        String a=new String("m,i,n,g,r,i,k,e,j,i,j,a,v,a,b,u");
        char[] new1=a.toCharArray();
        for(int i=0;i<new1.length;i++)
            if(new1[i] ==a1[0])
                sum++;
        System.out.println(sum);

    }

}



